import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login/login.vue'
import Gas from '../views/gas/Gas.vue'
import Water from '../views/water/Water.vue'

Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/water' // 重定向
  },
  {
    path: '/water',
    name: 'Water',
    component: Water,
    meta: {
      title: '水生态',
      isTab: true,
      header:true,
    }
  },
  {
    path: '/gas',
    name: 'Gas',
    component: Gas,
    meta: {
      title: '大气生态',
      isTab: true,
      header:true,
    }
  },

  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/login.vue')
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/wellLid',
    name: 'wellLid',
    component: () => import('../views/wellLid/index.vue'),
    meta: {
      title: '智能井盖',
      isTab: true,
      header:true,
    }
  },
  {
    path: '/forest',
    name: 'Forest',
    component: () => import('../views/forest/forest.vue'),
    meta: {
      title: '森林防火',
      isTab: true,
      header:true,
    }
  },
  {
    path: '/codelogin',
    name: 'Codelogin',
    component: () => import('../views/codelogin/codelogin.vue'),
    meta: {
      title: '手机短信登录',
      header:false,
    }
  },
  {
    path: '/permissions',
    name: 'permissions',
    component: () => import('../views/permissions/permissions.vue'),
    meta: {
      title: '权限',
      header:false,
    }
  },
  {
    path: '/channel',
    name: 'channel',
    component: () => import('../views/channel/Channel'),
    meta: {
      title: '导入'
    }
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

const router = new VueRouter({
  routes,
  mode: 'hash'
})

export default router
